package com.liu.thymeleaf.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 视图解析：SpringBoot默认不支持 JSP，需要引入第三方模板引擎技术实现页面渲染。
 *
 *
 * 静态资源目录
 * 	  private static final String[] CLASSPATH_RESOURCE_LOCATIONS = { "classpath:/META-INF/resources/",
 * 			                     "classpath:/resources/", "classpath:/static/", "classpath:/public/" };
 *
 * ThymeleafProperties配好了 ThymeleafViewResolver
 *	  public static final String DEFAULT_PREFIX = "classpath:/templates/"
 * 	  public static final String DEFAULT_SUFFIX = ".html";  //xxx.html
 */
@Controller
@RequestMapping("/hello")
public class HelloController {

    /**
     * 问题来了，thymeleaf的文件应该写在什么地方呢？
     * @return
     */
    @RequestMapping("/01")
    public String hello01(Model model){
        model.addAttribute("msg","我是MT！！");
        return "index";
    }
}
